package com.example.clientbwic.mapper;

import com.example.clientbwic.entity.Bwic;
import com.example.clientbwic.entity.Client;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 86150
 * @Date: 2024/4/9
 * @Description: com.example.clientbwic.mapper
 */
@Mapper

public interface BwicMapper {

    @Select("SELECT * FROM bid LEFT JOIN bwic ON bid.bwic_id = bwic.bwic_id WHERE client_id = #{id} GROUP BY bwic.bwic_id LIMIT 50")
    List<Bwic> getBwicListByClientId(String id);//获取客户已经购买的债券列表

    @Select("select * from bwic LIMIT 50")
    List<Bwic> getBwicList();//获取所有债券列表
}
